package com.canbot.u05.activity.presidemode.newcode.view;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.canbot.u05.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class NHostExitDialog extends NHostBaseDialog {
    public static final int CLOSE = 1;
    public static final int SAVE = 2;
    @BindView(R.id.content)
    TextView content;

    public NHostExitDialog(Context context, int type) {
        super(context);
        View view = LayoutInflater.from(this.getContext()).inflate(R.layout.nhost_exit_dialog, null);
        setContentView(view);
        ButterKnife.bind(this, view);
        initData(type);
    }

    private void initData(int type) {
        if (type == CLOSE) {
            content.setText(getContext().getResources().getString(R.string.exitTip));
        } else {
            content.setText(getContext().getResources().getString(R.string.savaTip));
        }
    }

    @OnClick({R.id.btn_cancel, R.id.btn_normal})
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_cancel:
                dismiss();
                break;
            case R.id.btn_normal:
                dismiss();
                if (iDialogBtnLisenter != null) {
                    iDialogBtnLisenter.onConfirm(null);
                }
                break;
        }
    }
}
